package view;

import java.awt.FlowLayout;
import java.awt.event.MouseListener;
import java.util.EventListener;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

public class OptionPanel extends JPanel
{
	private JLabel outputLabel;
	private String optionType;

	public OptionPanel(String text, String filepath, EventListener controller)
	{
		optionType = text;
		this.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 2));
		outputLabel = new JLabel(text, new ImageIcon(filepath), SwingConstants.CENTER);
		outputLabel.setHorizontalTextPosition(SwingConstants.CENTER);
		outputLabel.setVerticalTextPosition(SwingConstants.BOTTOM);
		outputLabel.setIconTextGap(0);
		this.add(outputLabel);
		this.addMouseListener((MouseListener) controller);
	}

	public JLabel getOutputLabel()
	{
		return outputLabel;
	}
	
	public String getOptionType()
	{
		return optionType;
	}
}
